package com.ld.security.server.admin.modules.msg.api;


import com.ld.security.auth.shiro.util.LoginUtil;
import com.ld.security.common.mybatis.base.po.PagePo;
import com.ld.security.common.mybatis.base.vo.DataVo;
import com.ld.security.common.tomcat.anno.AjaxLogKey;
import com.ld.security.common.tomcat.base.api.SuperApi;
import com.ld.security.server.admin.modules.msg.entity.MsgUserEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


@RestController
@Api(tags="用户消息Api管理")
@RequestMapping("/api/msgUser")
public class MsgUserApi  extends SuperApi<MsgUserEntity>{

        @AjaxLogKey
        @ApiOperation("查询我的消息")
        @RequestMapping(value = "/getMyMsg",method = RequestMethod.POST)
        public DataVo getMyMsg(@Valid @RequestBody PagePo<MsgUserEntity> po){
                String userId = LoginUtil.getUserId();
                po.getQuery().setToUser(userId);
                return this.page(po);
        }



        }
